home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
clarion
/
cw15
/
examp15.z
/
HEXEDIT.APP
(
.txt
)
< prev
next >
Wrap
Clarion Topspeed Data File
|
1995-10-05
|
27KB
|
932 lines
CurrentTab
CurrentTab:
CurrentTab
6?CurrentTab:Prompt
tCurrentTab:
CurrentTab
c@s80
CurrentTab
ForceRefresh
@n-13
ForceRefresh:
ForceRefresh
B?ForceRefresh:Prompt
ompForceRefresh:
iaForceRefresh
wIn@n-13
EForceRefresh
ind@n-13
@n-13
WindowInitialized
@n-13
WindowInitialized:
WindowInitialized
N?WindowInitialized:Prompt
ndWindowInitialized:
pWindowInitialized
@n-13
9WindowInitialized
@n-13
WindowOpened
@n-13
WindowOpened:
WindowOpened
B?WindowOpened:Prompt
WindowOpened:
:WindowOpened
qu@n-13
0WindowOpened
qu@n-13
LocalResponse
@n-13
LocalResponse:
LocalResponse
B?LocalResponse:Prompt
LocalResponse:
:LocalResponse
qu@n-13
ELocalResponse
qu@n-13
OriginalRequest
@n-13
OriginalRequest:
OriginalRequest
F?OriginalRequest:Prompt
OriginalRequest:
ocaOriginalRequest
@n-13
7OriginalRequest
@n-13
LocalRequest
@n-13
LocalRequest:
LocalRequest
B?LocalRequest:Prompt
LocalRequest:
LocalRequest
@n-13
@LocalRequest
@n-13
2Clarion for Windows Hex Editor
&File
?FileMenu
Open...
?FileOpen
>E&xit
?Exit
Exit this application
STD:Close
&Edit
?EditMenu
FCu&t
Remove item to Windows Clipboard
STD:Cut
>&Copy
?Copy
Copy item to Windows Clipboard
STD:Copy
H&Paste
?Paste
Paste contents of Windows Clipboard
STD:Paste
>&Window
Create and Arrange windows
STD:WindowList
JT&ile
?Tile
Make all open windows visible
STD:TileWindow
F&Cascade
?Cascade
Stack all open windows
STD:CascadeWindow
J&Arrange Icons
?Arrange
Align all window icons
STD:ArrangeIcons
&&Help
?Help
STD:Help
V&Contents
?Helpindex
the contents of the help file
HelpIndex
V&Search for Help On...
?HelpSearch
ch for help on a subject
HelpSearch
V&How to Use Help
?HelpOnHelp
to use Windows Help
HelpOnHelp
AppFrame
%AfterWindowOpening
AppFrameRef &= AppFrame
the corresponding character
1?EditASCII{PROP:SelEnd} = ?List{PROP:column} - 1
! in the ENTRY control
ELSE $)! but if the ?EditASCII is highlighted
SELECT(?EditASCII)
! select it for editing
OF EVENT:Accepted
IF KEYCODE() = MouseLeft2
'!When user double-clicks on the list
IF NOT FileRead
.!Check to see if the whole file is in the Q
XMESSAGE('You can''t edit until the file read is complete','Wait a minute!',ICON:Hand)
CYCLE
2! and bail out if the file read is not finished
GET(Q,CHOICE())
)!Get the currently highlighted Q entry
3?EditHex{PROP:use} = Hex[?List{PROP:column} - 1]
06!Set ENTRY's USE attribute to highlighted Hex field
1?List{PROP:edit,?List{PROP:column}} = ?EditHex
!Enable edit-in-place
SELECT(?EditHex)
!! and select the ENTRY control
OF ?EditHex !%!For the HEX editing ENTRY control
CASE EVENT()
OF EVENT:Selected
!When selected for edit
?EditHex{PROP:Touched} = 1
)! force the EVENT:Accepted to generate
"ChangeBuffer = CONTENTS(?EditHex)
"! and save the current contents
OF EVENT:Accepted
!When user leaves the control
4IF CLIP(ChangeBuffer) <> CLIP(CONTENTS(?EditHex))
! check for changes
Q:Changed = 1
! flag the Q entry as changed
ChangedQ = 1
! and flag the Q as changed
DO BuildStringDisplay
'! then format the ASCII text version
DISPLAY
! and display it
PUT(Q) %! then put the entry back in the Q
%IF ERRORCODE() THEN STOP(ERROR()).
C?List{PROP:edit,?List{PROP:column}} = 0 !Turn off edit-in-place
?EditHex{PROP:Hide} = 1
! hide the ENTRY control
SELECT(?List)
! and select the list
END
BuildQue ROUTINE
9!This ROUTINE builds the display QUEUE
LOOP 128 TIMES
!Going to read 2K bytes
NEXT(InFile)
! 16 bytes at a time
IF ERRORCODE()
!If end of file
FileRead = 1
! flag the file as read
StatusText = 'All Bytes read
*' ! setup the status bar text display
BREAK %
! and break out of the loop
Q:Buffer = InFile:Buffer
!Assign text to queue
DO BuildHexDisplay
0! and build the Hexadecimal values to display
Q:RecPtr = POINTER(InFile)
-! get the current byte address in the file
)StatusText = Q:RecPtr & ' ' & FileToEdit
&! setup the status bar text display
ADD(Q) &
! and add the entry to the Q
IF ERRORCODE()
"!Check for any unexpected error
FileRead = 1
! flag the file as read
BREAK %
! and break out of the loop
END
IF FileRead THEN Win1{PROP:Timer} = 0.
Y!Turn off the timer when the file is read
AppFrameRef{PROP:StatusText,1} = StatusText
:!Display the status bar text
ProcedureReturn ROUTINE
;!This ROUTINE cleans up after the procedure
IF ChangedQ #+!Check for changes made to the Q entries
xIF MESSAGE('Write changes to file?','Clarion Hex Editor',ICON:Question,BUTTON:Yes+BUTTON:No,BUTTON:No,1) = BUTTON:Yes
0'!Ask whether to save changes to file
LOOP X# = 1 TO RECORDS(Q)
!Process all Q entries
GET(Q,X#)
! one at a time
%IF ERRORCODE() THEN STOP(ERROR()).
IF NOT Q:Changed THEN CYCLE.
1!Get the next entry if this one hasn't changed
GET(InFile,Q:RecPtr)
!Get the record from the file
%IF ERRORCODE() THEN STOP(ERROR()).
InFile:Buffer = Q:Buffer
*!Assign changed data to the file buffer
PUT(InFile)
"! and write the changes to disk
%IF ERRORCODE() THEN STOP(ERROR()).
END
CLOSE(InFile) !<!Close the file
AppFrameRef{PROP:StatusText,2} = ' {80}'
U!Clean up the status bar text
AppFrameRef{PROP:StatusText,1} = ' {80}'
FREE(Q) ')!Free the memory used by the Q
RETURN (9! and return to the AppFrame
BuildHexDisplay ROUTINE
<!This ROUTINE transalates ASCII to HEX
LOOP Y# = 1 TO 16
!!Loop through ASCII characters
$Hex[Y#] = StringToHex(Q:Buffer[Y#]) n! Pass ASCII to function and get back HEX
END
DO BuildASCIIStringDisplay
BuildStringDisplay ROUTINE
<!This ROUTINE transalates HEX to ASCII
LOOP Y# = 1 TO 16
!Loop through HEX values
$Q:Buffer[Y#] = HexToString(Hex[Y#]) s! Pass HEX to function and get back ASCII
END
DO BuildASCIIStringDisplay
BuildASCIIStringDisplay ROUTINE
3!This ROUTINE traps 00 HEX to
LOOP Y# = 1 TO 16
'! format the ASCII display correctly
IF Q:Buffer[Y#] <> '<0>'
!If the character is not 00h
#Q:BufferDisplay[Y#] = Q:Buffer[Y#]
! just put it in the display
ELSE (
! but if it is 00h
Q:BufferDisplay[Y#] = '<20h>'
! display a blank
END
C:\CW15\BIN\CW15EXAM.HLP
Clarion
-- Generator
#noedit
#system win
#model clarion dll
#pragma debug(vid=>full)
#compile HEXED_RD.CLW-- GENERATED
#compile HEXED_RU.CLW-- GENERATED
#compile HEXED_SF.CLW-- GENERATED
#compile HEXEDIT.clw /define(GENERATED=>on)-- GENERATED
#compile HEXED001.clw /define(GENERATED=>on)-- GENERATED
#compile HEXED002.clw /define(GENERATED=>on)-- GENERATED
#compile HEXED003.clw /define(GENERATED=>on)-- GENERATED
#compile HEXED004.clw /define(GENERATED=>on)-- GENERATED
#pragma link(C%L%DOS%S%.LIB)
#link HEXEDIT.EXE
%GenerationCompleted
%Module
HEXEDIT.clw
HEXED001.clw
HEXED002.clw
HEXED003.clw
HEXED004.clw
%LastTarget32
%LastProgramExtension
%LastApplicationDebug
%LastApplicationLocalLibrary
L %ProgramAuthor
%MessageDescription
%GlobalExternal
%GenerateEmbedComments
%INIActive
H%INIFile
Program Name.INI
%ININame
%DefaultGenerate
%DefaultCloseFile
Close the File
%DefaultRILogout
%WarnOnLogoutError
%DefaultThreaded
Use File Setting
%DefaultCreate
Use File Setting
%DefaultExternal
None External
%DefaultExternalSource
%DefaultExternalAPP
%DefaultExport
%DefaultOpenMode
Share
%DefaultUserAccess
Read/Write
%DefaultOtherAccess
Deny None
%OverrideGenerate
%File
%OverrideCloseFile
%File
Use Default
%OverrideRILogout
%File
Use Default
%OverrideThreaded
%File
Use Default
%OverrideCreate
%File
Use Default
%OverrideExternal
%File
Use Default
%OverrideExternalSource
%File
%OverrideExternalAPP
%File
"%OverrideExport
%File
%OverrideOpenMode
%File
Use Default
%OverrideUserAccess
%File
Use Default
%OverrideOtherAccess
%File
Use Default
%INISaveWindow
%ButtonAction
%Control
?Exit
No Special Action
?FileOpen
Call a Procedure
No Special Action
?Copy
No Special Action
?Paste
No Special Action
?Tile
No Special Action
?Cascade
No Special Action
?Arrange
No Special Action
?FileMenu
No Special Action
?Help
No Special Action
No Special Action
%MenuAction
%Control
?Exit
No Special Action
%Parameters
%ReturnValue
%ButtonRunName
%Control
?FileOpen
?Exit
?Copy
?Paste
?Tile
?Cascade
?Arrange
?FileMenu
?Help
%ButtonRunParameters
%Control
?FileOpen
?Exit
?Copy
?Paste
?Tile
?Cascade
?Arrange
?FileMenu
?Help
%ButtonProcedure
%Control
?FileOpen
?Exit
?Copy
?Paste
?Tile
?Cascade
?Arrange
?FileMenu
?Help
:%ButtonThread
%Control
?FileOpen
?Exit
?Copy
?Paste
?Tile
?Cascade
?Arrange
?FileMenu
?Help
%ButtonThreadStack
%Control
?FileOpen
25000
?Exit
25000
25000
?Copy
25000
?Paste
25000
?Tile
25000
?Cascade
25000
?Arrange
25000
?FileMenu
25000
?Help
25000
25000
%ButtonParameters
%Control
?FileOpen
?Exit
?Copy
?Paste
?Tile
?Cascade
?Arrange
?FileMenu
?Help
%ButtonRequest
%Control
?FileOpen
?Exit
?Copy
?Paste
?Tile
?Cascade
?Arrange
?FileMenu
?Help
%PreLookupKey
%Control
?FileOpen
?FileMenu
?Help
%PreLookupField
%Control
?FileOpen
?FileMenu
?Help
%PreLookupProcedure
%Control
?FileOpen
?FileMenu
?Help
%PostLookupKey
%Control
?FileOpen
?FileMenu
?Help
%PostLookupField
%Control
?FileOpen
?FileMenu
?Help
%PostLookupProcedure
%Control
?FileOpen
?FileMenu
?Help
%PostLookupDuringValidate
%Control
?FileOpen
?FileMenu
?Help
%ForceWindowRefresh
%Control
?FileOpen
?FileMenu
?Help
%CheckedAssigns
%Control
%CheckedAssignVariable
%CheckedAssigns
?FileOpen
?FileMenu
?Help
%CheckedAssignValue
%CheckedAssigns
?FileOpen
?FileMenu
?Help
%CheckedHides
%Control
%CheckedControl
%CheckedHides
?FileOpen
?FileMenu
?Help
%CheckedControlAction
%CheckedHides
?FileOpen
?FileMenu
?Help
%UncheckedAssigns
%Control
%UncheckedAssignVariable
%UncheckedAssigns
?FileOpen
?FileMenu
?Help
%UncheckedAssignValue
%UncheckedAssigns
?FileOpen
?FileMenu
?Help
%UnCheckedHides
%Control
%UnCheckedControl
%UnCheckedHides
?FileOpen
?FileMenu
?Help
%UnCheckedControlAction
%UnCheckedHides
?FileOpen
?FileMenu
?Help
%Parameters
%Parameters
(StringToConvert)
%Parameters
(StringToConvert)
Clarion$Clarion
Clarion$GENERATED
Clarion$GENERATED
Clarion$GENERATED
Clarion$GENERATED
Clarion$Frame
Clarion$DateTimeDisplay
%DisplayDate
%DatePicture
October 31, 1959
%OtherDatePicture
%ShowDayOfWeek
%DateDisplayLocation
Status Bar
%DateStatusSection
%DateControl
%DisplayTime
%TimePicture
5:30PM
%OtherTimePicture
%TimeDisplayLocation
Status Bar
%TimeStatusSection
%TimeControl
>EditFile
Clarion$Source
StringToHex
(STRING),STRING
Clarion$Source
HexToString
(STRING),STRING
Clarion$Source
AppFrameRef
App Frame Ref:
App Frame Ref
L@s20
?AppFrameRef:Prompt
App Frame Ref:
AppFrameRef
AppFrameRef
M&42B2
%DataSection
FileToEdit
STRING(80),STATIC,THREAD
*!File's NAME attribute variable
FileSize
LONG
#!File size save variable
FileRead
BYTE(0)
!File all read flag
ChangedQ
BYTE(0)
.!QUEUE changed flag
ChangeBuffer STRING(16)
+!Q entry editing save variable
StatusText
STRING(80)
d!Status bar tex formatting
InFile FILE,DRIVER('DOS','/FILEBUFFERS=4'),NAME(FileToEdit),THREAD
RECORD
!Input file
Buffer
STRING(16)
QUEUE,PRE(Q)
!List box display QUEUE
RecPtr
HexGroup GROUP !
!HEX display fields
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
STRING(2)
BufferDisplay
STRING(16)
!ASCII display field
Buffer
STRING(16)
&!ASCII display column
Changed BYTE "
!QUEUE entry changed flag
#STRING(2),DIM(16),OVER(Q:HexGroup)
!HEX editing array, OVER the display fields
Win1 WINDOW('List Edit In Place'),AT(,,300,169),FONT('Courier New',10,,FONT:regular),ALRT(MouseRight), |
'TIMER(1),SYSTEM,GRAY,DOUBLE,MDI,MASK
MENUBAR
MENU('&File'),USE(?File)
&ITEM('Close'),USE(?FileClose),FIRST
MENU('&Edit'),USE(?Edit)
'ITEM('&Hex'),USE(?EditHexMenu),FIRST
LIST,AT(0,0,300,169),USE(?List),IMM,VSCROLL,COLUMN,FORMAT('28L|~Offset~@n06@[14L(2)@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L' &|
X'@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L@s2@12L@s2@]|~Hexadecimal~60L(2)~ASCII' &|
' Text~@s16@'),FROM(Q)
2ENTRY(@S2),AT(60,61),USE(?EditHex),OVR,UPR,HIDE
0ENTRY(@S2),AT(60,61),USE(?EditASCII),OVR,HIDE
%ProcessedCode
6 IF NOT FILEDIALOG('Choose File to Edit',FileToEdit,'All Files|*.*',0)
RETURN &1!Return if no file chosen
END
OPEN(InFile) "!!Open the file
IF ERRORCODE()
! aborting on any error
RMESSAGE('Error ' & ERRORCODE() & ' opening file: ' & ERROR(),'ERROR',ICON:Hand)
RETURN #
END
OPEN(Win1) $-!Open the window
FileSize = BYTES(InFile)
5!Get the file size
Win1{PROP:Text} = NAME(InFile)
n!Display filename in the title bar
AppFrameRef{PROP:StatusText,2} = 'File Size - ' & FileSize & ' Bytes'
00!Display file size in status bar
SET(InFile) #%!Start at top of file
DO BuildQue #1!Get the first 2K of the file
SELECT(?List,1)
D!Put the highlight bar on the first entry
?List{PROP:Column} = 2
.! but put it in the second column
GET(Q,1) &S!Synchronize the Q buffer with the first entry
?List{PROP:edit,18} = ?EditASCII
S!Put ?EditASCII ENTRY control on col 18
?EditASCII{PROP:use} = Q:BufferDisplay
J! to display the data's ASCII text version
?EditASCII{PROP:text} = '@K?
_K' ! then make sure all 16 characters display (no clipping)
?EditASCII{PROP:SelStart} = 1
O!Highlight the first character in the ENTRY box
?EditASCII{PROP:SelEnd} = 1
M! to correspond to the highlighted HEX value
?EditASCII{PROP:Disable} = 1
4!Disable the field so it's display-only
ACCEPT
CASE EVENT() .!Field-independent event handling structure
OF EVENT:GainFocus
!When the window gains focus
HAppFrameRef{PROP:StatusText,2} = 'File Size - ' & FileSize & ' Bytes'
0#!Display file size in status bar
VAppFrameRef{PROP:StatusText,1} = StatusText ! and display current file read status
OF EVENT:AlertKey
!When the user
IF KEYCODE() = MouseRight
! presses right-click
EXECUTE POPUP('Edit|Close')
! display a popup menu
BEGIN !
! for HEX mode editing
SETKEYCODE(MouseLeft2)
4! set the KEYCODE function to return double-click
POST(EVENT:Accepted,?List)
9! and execute the EVENT:Accepted code for the list box
POST(EVENT:Accepted,?FileClose)
<!For the Close selection, choose the File>Close menu item
CYCLE #
!Go back to ACCEPT
OF EVENT:Timer
!When the timer goes off
DO BuildQue
! read another 2K of the file
CASE FIELD() +!Field-specific event handling structure
OF ?EditHexMenu
!For the Hex Edit menu item
SETKEYCODE(MouseLeft2)
4! set the KEYCODE function to return double-click
POST(EVENT:Accepted,?List)
9! and execute the EVENT:Accepted code for the list box
OF ?FileClose
!For the Close menu item
IF EVENT() = EVENT:Accepted
! check for EVENT:Accepted
DO ProcedureReturn
+! and DO the procedure "cleanup" ROUTINE
OF ?List $
!For the List box
CASE EVENT()
!Check the event
OF EVENT:ScrollUp
!When scrolling up one record
IF CHOICE() = 1
! see if on first entry
SELECT(?List,1)
! and stay on it
ELSE $
! otherwise
SELECT(?List,CHOICE()-1)
! go to the previous entry
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:ScrollDown
"!When scrolling down one record
IF CHOICE() = RECORDS(Q)
! see if on last entry
SELECT(?List,RECORDS(Q))
! and stay on it
ELSE $
! otherwise
SELECT(?List,CHOICE()+1)
! go to the next entry
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:PageUp
!When scrolling up one page
IF CHOICE() < ?LIST{PROP:Items}
! see if on first page
SELECT(?List,1)
! and go to first entry
ELSE $
! otherwise
FSELECT(?List,CHOICE()-?LIST{PROP:Items}) ! go to the previous page
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:PageDown
!When scrolling down one page
DIF CHOICE() > RECORDS(Q)-?LIST{PROP:Items} ! see if on last page
SELECT(?List,RECORDS(Q))
! and go to last entry
ELSE $
! otherwise
BSELECT(?List,CHOICE()+?LIST{PROP:Items}) ! go to the next page
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:ScrollTop
!When scrolling to the top
SELECT(?List,1)
! go to first entry
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:ScrollBottom
!When scrolling to the bottom
SELECT(?List,RECORDS(Q))
! go to last entry
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:ScrollDrag
(!When user moves the scroll bar thumb
IF ?List{PROP:VScrollPos}
! if it's not at the top
LSELECT(?List,?List{PROP:VScrollPos}) ! go to the thumb position's entry
ELSE $
! otherwise
SELECT(?List,1)
! go to first entry
POST(EVENT:NewSelection,?List)
/!Force synchronization between HEX and ASCII
OF EVENT:NewSelection
&!When the user moves to a new entry
GET(Q,CHOICE())
3! get it so ?EditASCII displays the correct data
IF ?List{PROP:column} = 1
2!Check for an attempt to edit the offset column
?List{PROP:column} = 2
! and don't allow it
ELSIF ?List{PROP:column} = 18
1!Check for an attempt to edit the ASCII column
?List{PROP:column} = 17
! and don't allow it
DO BuildASCIIStringDisplay
<!Build display string for the ASCII display ENTRY control
DISPLAY(?EditASCII)
! then display it
IF ?List{PROP:column} <> 18
%!See if a HEX value is highlighted
T?EditASCII{PROP:SelStart} = ?List{PROP:column} - 1 ! and highlight
%DataSection
ByteToConvert BYTE,OVER(StringToConvert)
@!BYTE re-declaration of passed STRING
ReturnString STRING(2)
:!Return data
%ProcessedCode
ReturnString = '00'
8!Initialize return variable
EXECUTE ByteToConvert/16
!!Format high-order nibble from
ReturnString[1] = '1'
! result of division by 16
ReturnString[1] = '2'
ReturnString[1] = '3'
ReturnString[1] = '4'
ReturnString[1] = '5'
ReturnString[1] = '6'
ReturnString[1] = '7'
ReturnString[1] = '8'
ReturnString[1] = '9'
ReturnString[1] = 'A'
ReturnString[1] = 'B'
ReturnString[1] = 'C'
ReturnString[1] = 'D'
ReturnString[1] = 'E'
;ReturnString[1] = 'F'
END
EXECUTE ByteToConvert % 16
!Format low-order nibble from
ReturnString[2] = '1'
$! the remainder of division by 16
ReturnString[2] = '2'
ReturnString[2] = '3'
ReturnString[2] = '4'
ReturnString[2] = '5'
ReturnString[2] = '6'
ReturnString[2] = '7'
ReturnString[2] = '8'
ReturnString[2] = '9'
ReturnString[2] = 'A'
ReturnString[2] = 'B'
ReturnString[2] = 'C'
ReturnString[2] = 'D'
ReturnString[2] = 'E'
BReturnString[2] = 'F'
END
RETURN(ReturnString)
%DataSection
ReturnString STRING(1)
!Return variable
ByteString
BYTE,OVER(ReturnString)
X!BYTE re-declaration of the return variable
%ProcessedCode
ByteString = 0 B!Initialize the return variable
IF NUMERIC(StringToConvert[1])
1!Check for decimal number in high-order nibble
%ByteString = StringToConvert[1] * 16
"! and multiply it by 16
ELSE
CASE StringToConvert[1]
!Convert alpha HEX numbers
OF 'A'
ByteString = 10 * 16
OF 'B'
ByteString = 11 * 16
OF 'C'
ByteString = 12 * 16
OF 'D'
ByteString = 13 * 16
OF 'E'
ByteString = 14 * 16
OF 'F'
ByteString = 15 * 16
END
IF NUMERIC(StringToConvert[2])
0!Check for decimal number in low-order nibble
!ByteString += StringToConvert[2]
+! and add it to high-order value
ELSE
CASE StringToConvert[2]
!Convert alpha HEX numbers
OF 'A'
ByteString += 10
OF 'B'
ByteString += 11
OF 'C'
ByteString += 12
OF 'D'
ByteString += 13
OF 'E'
ByteString += 14
OF 'F'
ByteString += 15
END
RETURN(ReturnString)